﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace Smith.ImageConverter
{
    public abstract class BaseConvert : IConvert
    {
        public abstract void Save(Bitmap image, string path);

        public static ImageCodecInfo GetImageCodeInfo(string type)
        {
            ImageCodecInfo[] info = ImageCodecInfo.GetImageEncoders();
            foreach (ImageCodecInfo i in info)
                if (i.MimeType == type) return i;
            return null;
        }

        public ImageCodecInfo CodeInfo { get; protected set; }
        public EncoderParameters Parameters { get; protected set; }
    }
}
